﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:DevPhone.Controls">

    <sys:String x:Key="UpDownControlRightArrow">M0,0 L1,0.5 0,1Z</sys:String>
    <sys:String x:Key="UpDownControlLeftArrow">M0,0.5 L1,1 1,0Z</sys:String>
    <local:InverseVisibleTypeConverter x:Key="InverseVisible"/>


    <Style x:Key="UpDownControlButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="#01FFFFFF"/>
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
        <Setter Property="Padding" Value="10,3,10,5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="ContentContainer"
                                            Storyboard.TargetProperty="Opacity"
                                            Duration="0"
                                            To="1.0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                            Storyboard.TargetName="ContentContainer"
                                            Storyboard.TargetProperty="Opacity"
                                            Duration="0"
                                            To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                            Storyboard.TargetName="ContentContainer"
                                            Storyboard.TargetProperty="Opacity"
                                            Duration="0"
                                            To="0.4"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
                            <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:UpDownControl">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:UpDownControl">
                    <Border
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Padding="{TemplateBinding Padding}"
                        Background="{TemplateBinding ControlBackground}"
                        CacheMode="BitmapCache">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="UpDownRootPart"
                                            Storyboard.TargetProperty="Opacity"
                                            Duration="0"
                                            To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="UpDownRootPart"
                                            Storyboard.TargetProperty="Opacity"
                                            Duration="0"
                                            To="0.65"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="UpDownRootPart">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <StackPanel x:Name="ValueArea" Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center">
                                <TextBlock x:Name="TextValue" Text="{TemplateBinding CurrentValue}"/>
                                <TextBlock x:Name="TextInfo" Text="{TemplateBinding TextAfterValue}" />
                            </StackPanel>
                            <StackPanel x:Name="ArrowArea" Orientation="Horizontal" Margin="0" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
                                <Button x:Name="BntLeft" BorderThickness="0" Padding="0" Margin="0" Style="{StaticResource UpDownControlButtonStyle}" >
                                    <Path x:Name="ArrowLeft" Data="{StaticResource UpDownControlLeftArrow}" Width="74" Height="64"  Stretch="Uniform"  Fill="{StaticResource PhoneAccentBrush}" />
                                </Button>
                                <Border x:Name="BntGap" BorderThickness="0" Width="{TemplateBinding GapArrow}" />
                                <Button x:Name="BntRight" BorderThickness="0" Padding="0" Margin="0" Style="{StaticResource UpDownControlButtonStyle}">
                                    <Path x:Name="ArrowRight" Data="{StaticResource UpDownControlRightArrow}" Width="74" Height="64"  Stretch="Uniform"  Fill="{StaticResource PhoneAccentBrush}" />
                                </Button>
                            </StackPanel>
                            <ContentControl
                                x:Name="Header"
                                Content="{TemplateBinding Header}"
                                ContentTemplate="{TemplateBinding HeaderTemplate}"
                                FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                FontSize="{StaticResource PhoneFontSizeNormal}"
                                Foreground="{TemplateBinding Foreground}"
                                HorizontalAlignment="Left"
                                IsTabStop="False"
                                Grid.ColumnSpan="2"
                                Margin="-1,0,0,0"
                                Opacity="{TemplateBinding Opacity}"
                                VerticalAlignment="Bottom"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:CalendarControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CalendarControl">
                    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Background="{TemplateBinding Background}">
                        <StackPanel.Projection>
                            <PlaneProjection GlobalOffsetX="0.5" GlobalOffsetY="0.5"/>
                        </StackPanel.Projection>
                        <StackPanel x:Name="DayCalendar" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}">
                            <StackPanel.Projection>
                                <PlaneProjection GlobalOffsetX="0.5" GlobalOffsetY="0.5"/>
                            </StackPanel.Projection>
                            <!-- Title -->
                            <StackPanel Orientation="Horizontal" Margin="0" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                <Grid Width="455" Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Orientation="Horizontal" Grid.Column="0" >
                                        <TextBlock x:Name="MonthValue" FontSize="32" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Left"/>
                                        <TextBlock x:Name="YearValue"  FontSize="32" Margin="30,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Left"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Grid.Column="1">
                                        <TextBlock x:Name="TodayLnk" FontSize="32" Margin="0,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Right"/>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                            <!-- Week -->
                            <StackPanel Orientation="Horizontal" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                <Border x:Name="BT1" BorderThickness="2,2,1,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T1" FontWeight="Bold" FontSize="24"  HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                                <Border x:Name="BT2" BorderThickness="1,2,1,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T2" FontWeight="Bold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                                <Border x:Name="BT3" BorderThickness="1,2,1,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T3" FontWeight="Bold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                                <Border x:Name="BT4" BorderThickness="1,2,1,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T4" FontWeight="Bold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                                <Border x:Name="BT5" BorderThickness="1,2,1,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T5" FontWeight="Bold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                                <Border x:Name="BT6" BorderThickness="1,2,1,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T6" FontWeight="Bold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                                <Border x:Name="BT7" BorderThickness="1,2,2,1" Height="65" BorderBrush="{TemplateBinding BorderBrush}" Width="65" Background="{TemplateBinding WeekBackground}">
                                    <TextBlock x:Name="T7" FontWeight="Bold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding WeekBrush}"/>
                                </Border>
                            </StackPanel>
                            <!-- days -->
                            <StackPanel x:Name="AreaDays">
                                <!-- days 1 week -->
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BD1" BorderThickness="2,1,1,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD1" >
                                            <TextBlock x:Name="D1" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD2" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD2">
                                            <TextBlock x:Name="D2" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD3" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD3">
                                            <TextBlock x:Name="D3" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD4" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD4">
                                            <TextBlock x:Name="D4" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD5" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD5">
                                            <TextBlock x:Name="D5" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD6" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD6">
                                            <TextBlock x:Name="D6" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD7" BorderThickness="1,1,2,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD7">
                                            <TextBlock x:Name="D7" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                </StackPanel>
                                <!-- days 2 week -->
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BD8" BorderThickness="2,1,1,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD8">
                                            <TextBlock x:Name="D8" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD9" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD9">
                                            <TextBlock x:Name="D9" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD10" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD10">
                                            <TextBlock x:Name="D10" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD11" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD11">
                                            <TextBlock x:Name="D11" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD12" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD12">
                                            <TextBlock x:Name="D12" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD13" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD13">
                                            <TextBlock x:Name="D13" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD14" BorderThickness="1,1,2,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD14">
                                            <TextBlock x:Name="D14" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                </StackPanel>
                                <!-- days 3 week -->
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BD15" BorderThickness="2,1,1,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD15">
                                            <TextBlock x:Name="D15" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD16" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD16">
                                            <TextBlock x:Name="D16" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD17" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD17">
                                            <TextBlock x:Name="D17" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD18" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD18">
                                            <TextBlock x:Name="D18" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD19" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD19">
                                            <TextBlock x:Name="D19" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD20" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD20">
                                            <TextBlock x:Name="D20" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD21" BorderThickness="1,1,2,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD21">
                                            <TextBlock x:Name="D21" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                </StackPanel>
                                <!-- days 4 week -->
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BD22" BorderThickness="2,1,1,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD22">
                                            <TextBlock x:Name="D22" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD23" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD23">
                                            <TextBlock x:Name="D23" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD24" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD24">
                                            <TextBlock x:Name="D24" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD25" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD25">
                                            <TextBlock x:Name="D25" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD26" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD26">
                                            <TextBlock x:Name="D26" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD27" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD27">
                                            <TextBlock x:Name="D27" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD28" BorderThickness="1,1,2,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD28">
                                            <TextBlock x:Name="D28" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                </StackPanel>
                                <!-- days 5 week -->
                                <StackPanel Orientation="Horizontal" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BD29" BorderThickness="2,1,1,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD29">
                                            <TextBlock x:Name="D29" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD30" BorderThickness="1,1,1,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD30">
                                            <TextBlock x:Name="D30" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD31" BorderThickness="1,1,1,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD31">
                                            <TextBlock x:Name="D31" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD32" BorderThickness="1,1,1,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD32">
                                            <TextBlock x:Name="D32" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD33" BorderThickness="1,1,1,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD33">
                                            <TextBlock x:Name="D33" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD34" BorderThickness="1,1,1,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD34">
                                            <TextBlock x:Name="D34" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                    <Border x:Name="BD35" BorderThickness="1,1,2,2" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Height="65" Width="65" >
                                        <Grid x:Name="GD35">
                                            <TextBlock x:Name="D35" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
    							                <TextBlock.Projection>
    								                <PlaneProjection/>
    							                </TextBlock.Projection>
                                            </TextBlock>
                                        </Grid>
                                    </Border>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel x:Name="MonthCalendar" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" Visibility="Collapsed">
                            <StackPanel.Projection>
                                <PlaneProjection GlobalOffsetX="0.5" GlobalOffsetY="0.5"/>
                            </StackPanel.Projection>
                            <!-- Title -->
                            <StackPanel Orientation="Horizontal" Margin="0" Background="{TemplateBinding Background}" Width="455">
                                <Grid Width="455" Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Orientation="Horizontal" Grid.Column="0" >
                                        <TextBlock x:Name="TitleMonth" FontSize="30" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Left"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Grid.Column="1">
                                        <TextBlock x:Name="NextMonthLnk" FontSize="30" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Right"/>
                                        <TextBlock x:Name="PrevMonthLnk" FontSize="30" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Right"/>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                            <!-- bottons  -->
                            <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                <Border x:Name="BMGODAY" BorderThickness="2,2,1,1" Height="95.5" BorderBrush="{TemplateBinding BorderBrush}" Width="227.5" Background="{TemplateBinding WeekBackground}" >
                                    <TextBlock x:Name="TitleMonthGoDay" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="{TemplateBinding WeekBrush}">
        					            <TextBlock.Projection>
        						            <PlaneProjection/>
        					            </TextBlock.Projection>
                                    </TextBlock>
                                </Border>
                                <Border x:Name="BMGOYEAR" BorderThickness="1,2,2,1" Height="95.5" BorderBrush="{TemplateBinding BorderBrush}" Width="227.5" Background="{TemplateBinding WeekBackground}" >
                                    <TextBlock x:Name="TitleMonthGoYear" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="{TemplateBinding WeekBrush}">
        					            <TextBlock.Projection>
        						            <PlaneProjection/>
        					            </TextBlock.Projection>
                                    </TextBlock>
                                </Border>
                            </StackPanel>
                            <!-- Months -->
                            <StackPanel x:Name="AreaMonths">
                                <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BM1" BorderThickness="2,1,1,1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="113.75" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M1" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM2" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="114.25" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M2" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM3" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="114.25" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M3" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM4" BorderThickness="1,1,2,1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="113.75" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M4" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BM5" BorderThickness="2,1,1,1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="113.75" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M5" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM6" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="114.25" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M6" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM7" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="114.25" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M7" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM8" BorderThickness="1,1,2,1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="113.75" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M8" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BM9" BorderThickness="2,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="113.75" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M9" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM10" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="114.25" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M10" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM11" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="114.25" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M11" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BM12" BorderThickness="1,1,2,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="113.75" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="M12" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel x:Name="YearCalendar" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{TemplateBinding Background}" Visibility="Collapsed">
                            <StackPanel.Projection>
                                <PlaneProjection GlobalOffsetX="0.5" GlobalOffsetY="0.5"/>
                            </StackPanel.Projection>
                            <!-- Title -->
                            <StackPanel Orientation="Horizontal" Margin="0" Background="{TemplateBinding Background}" Width="455">
                                <Grid Width="455" Background="{TemplateBinding Background}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Orientation="Horizontal" Grid.Column="0" >
                                        <TextBlock x:Name="TitleYear" FontSize="30" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Left"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Grid.Column="1">
                                        <TextBlock x:Name="NextYearLnk" FontSize="30" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Right"/>
                                        <TextBlock x:Name="PrevYearLnk" FontSize="30" Margin="5,10,10,10" MinWidth="140" MinHeight="40" TextAlignment="Right"/>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                <Border x:Name="BYGODAY" BorderThickness="2,2,1,1" Height="95.5" BorderBrush="{TemplateBinding BorderBrush}" Width="227.5" Background="{TemplateBinding WeekBackground}" >
                                    <TextBlock x:Name="TitleYearGoDay" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="{TemplateBinding WeekBrush}">
        				                <TextBlock.Projection>
        					                <PlaneProjection/>
        				                </TextBlock.Projection>
                                    </TextBlock>
                                </Border>
                                <Border x:Name="BYGOMONTH" BorderThickness="1,2,2,1" Height="95.5" BorderBrush="{TemplateBinding BorderBrush}" Width="227.5" Background="{TemplateBinding WeekBackground}" >
                                    <TextBlock x:Name="TitleYearGoMonth" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="{TemplateBinding WeekBrush}">
        				                <TextBlock.Projection>
        					                <PlaneProjection/>
        				                </TextBlock.Projection>
                                    </TextBlock>
                                </Border>
                            </StackPanel>
                            <!-- Years -->
                            <StackPanel x:Name="AreaYears">
                                <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BY0" BorderThickness="2,1,1,1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y0" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY1" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y1" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY2" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y2" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY3" BorderThickness="1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y3" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY4" BorderThickness="1,1,2,1" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y4" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BY5" BorderThickness="2,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y5" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY6" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y6" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY7" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y7" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY8" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y8" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY9" BorderThickness="1,1,2,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y9" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Background="{TemplateBinding Background}" >
                                    <Border x:Name="BY10" BorderThickness="2,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y10" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY11" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y11" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY12" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y12" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY13" BorderThickness="1,1,1,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y13" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                    <Border x:Name="BY14" BorderThickness="1,1,2,2" Height="97.5" BorderBrush="{TemplateBinding BorderBrush}" Width="91" Background="{TemplateBinding Background}" >
                                        <TextBlock x:Name="Y14" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
        					                <TextBlock.Projection>
        						                <PlaneProjection/>
        					                </TextBlock.Projection>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ExpanderControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ExpanderControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ViewStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="RotateButtonTransform"
                                        Storyboard.TargetProperty="Angle" To="180" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="RotateButtonTransform"
                                        Storyboard.TargetProperty="Angle" To="0" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border 
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                            <StackPanel>
                                <Grid Margin="0" x:Name="AreaHeader" Background="{TemplateBinding HeaderBackground}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" RenderTransformOrigin="0.5,0.5" x:Name="ExpandCollapsArea">
                                        <Border.RenderTransform>
                                            <RotateTransform x:Name="RotateButtonTransform"/>
                                        </Border.RenderTransform>
                                        <Grid VerticalAlignment="Center">
                                            <Ellipse x:Name="EllipseExpander" Margin="5" Width="50" Height="50" Fill="{TemplateBinding EllipseBrush}"/>
                                            <Path x:Name="ArrowExpander" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                                    Data="M2,3L9,10 16,3" Stroke="{TemplateBinding EllipseArrow}" StrokeThickness="4"/>
                                        </Grid>
                                    </Border>
                                    <TextBlock x:Name="Header" Foreground="{TemplateBinding HeaderBrush}" Text="{TemplateBinding Header}" HorizontalAlignment="Stretch"  Grid.Column="1" Margin="10,0,0,0" VerticalAlignment="Center"/>
                                </Grid>
                                <Border Background="{TemplateBinding Background}">
                                    <ContentControl
                                        x:Name="Content"
                                        Visibility="Collapsed"
                                        Content="{TemplateBinding Content}" 
                                        FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                        FontSize="{StaticResource PhoneFontSizeNormal}"
                                        FontWeight="Normal"
                                        FontStyle="Normal"
                                        FontStretch="Normal"
                                        HorizontalContentAlignment="Stretch"
                                        HorizontalAlignment="Stretch"
                                        IsTabStop="False"
                                        Margin="0"
                                        Opacity="{TemplateBinding Opacity}"
                                        VerticalAlignment="Stretch">
                                        <ContentControl.RenderTransform>
                                            <ScaleTransform x:Name="ContentScaleTransform"/>
                                        </ContentControl.RenderTransform>
                                    </ContentControl>
                                </Border>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:DropDownControl">
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DropDownControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ViewStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="RotateButtonTransform"
                                        Storyboard.TargetProperty="Angle" To="180" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="RotateButtonTransform"
                                        Storyboard.TargetProperty="Angle" To="0" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="RotateButtonTransform"
                                        Storyboard.TargetProperty="Angle" To="0" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border>
                            <StackPanel>
                                <ContentControl
                                    x:Name="Header"
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                    FontSize="{StaticResource PhoneFontSizeNormal}"
                                    Foreground="{StaticResource PhoneForegroundBrush}"
                                    HorizontalAlignment="Left"
                                    IsTabStop="False"
                                    Grid.ColumnSpan="2"
                                    Margin="0,0,0,5"
                                    Opacity="{TemplateBinding Opacity}"
                                    VerticalAlignment="Bottom"/>
                                <Border BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}">
                                    <Grid Margin="0" x:Name="AreaHeader" Background="{TemplateBinding Background}">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <ContentControl
                                        x:Name="SeletedContent"
                                        HorizontalAlignment="Stretch"
                                        HorizontalContentAlignment="Left"
                                        Margin="5,0"
                                        Foreground="{TemplateBinding Foreground}"
                                        Opacity="{TemplateBinding Opacity}"
                                        VerticalAlignment="Stretch"
                                        VerticalContentAlignment="Center"/>
                                        <Border Grid.Column="1" RenderTransformOrigin="0.5,0.5" x:Name="AreaEllipse">
                                            <Border.RenderTransform>
                                                <RotateTransform x:Name="RotateButtonTransform"/>
                                            </Border.RenderTransform>
                                            <Grid VerticalAlignment="Center">
                                                <Ellipse x:Name="EllipseExpander" Margin="5" Width="50" Height="50" Fill="{TemplateBinding EllipseBrush}"/>
                                                <Path x:Name="ArrowExpander" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                                    Data="M2,3L9,10 16,3" Stroke="{TemplateBinding EllipseArrow}" StrokeThickness="4"/>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border x:Name="HostItemPresenter"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{TemplateBinding Background}"
                                    HorizontalAlignment="Right"
                                    Height="0"
                                    Opacity="0"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="0,0,12.5,12.5"
                                    Padding="5">
                                    <ScrollViewer x:Name="sroolViewItems" >
                                        <ItemsPresenter />
                                    </ScrollViewer>
                                </Border>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:DropDownItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DropDownItem">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetName="ContentContainer"
                                            Storyboard.TargetProperty="Foreground"
                                            Duration="0">
                                            <DiscreteObjectKeyFrame
                                                Value="{StaticResource PhoneAccentBrush}"
                                                KeyTime="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <StackPanel HorizontalAlignment="Stretch" Background="#01FFFFFF">
                            <ContentControl
                            x:Name="ContentContainer"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Margin="0,12"
                            VerticalContentAlignment="Stretch"
                            HorizontalAlignment="Stretch"
                            HorizontalContentAlignment="Stretch"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:WindowsBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:WindowsBox">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowStates">
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootOverlay">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootOverlay">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="RootOverlay" Background="{TemplateBinding OverlayBrush}" RenderTransformOrigin="0.5,0.5" Opacity="0">
                            <Grid.RenderTransform>
                                <CompositeTransform/>
                            </Grid.RenderTransform>
                            <Grid x:Name="RootMessage" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20" RenderTransformOrigin="0.5,0.5" MaxHeight="{TemplateBinding WindowsMaxHeight}" MaxWidth="{TemplateBinding WindowsMaxWidth}" MinWidth="{TemplateBinding WindowsMinWidth}" >
                                <Grid.RenderTransform>
                                    <CompositeTransform/>
                                </Grid.RenderTransform>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition />
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border 
                                    Grid.Row="0"
                                    CornerRadius="{TemplateBinding CornerRadiusTop}" 
                                    Background="{TemplateBinding TitleBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessTitle}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}" >
                                    <Grid x:Name="TitleContent">
                                        <TextBlock 
                                            Text="{TemplateBinding Title}" 
                                            Margin="5" 
                                            VerticalAlignment="Center" 
                                            Foreground="{TemplateBinding TitleForeColor}"
                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                            FontSize="{StaticResource PhoneFontSizeMediumLarge}"
                                            HorizontalAlignment="Center" />
                                    </Grid>
                                </Border>
                                <Border 
                                    Grid.Row="1" 
                                    Background="{TemplateBinding MessageBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessMessage}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}">
                                    <Grid x:Name="MessageContent">
                                        <ScrollViewer x:Name="ScrollMessageContent">
                                            <ContentControl 
                                                x:Name="MessageNotification" 
                                                Margin="7" 
                                                Foreground="{TemplateBinding MessageForeColor}"
                                                HorizontalContentAlignment="Stretch"
                                                VerticalContentAlignment="Stretch"
                                                Content="{TemplateBinding MessageContent}">
                                            </ContentControl>
                                        </ScrollViewer>
                                    </Grid>
                                </Border>
                                <Border 
                                    Grid.Row="2" 
                                    CornerRadius="{TemplateBinding CornerRadiusBottom}" 
                                    Background="{TemplateBinding MessageBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessButtons}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}" 
                                    HorizontalAlignment="Stretch" 
                                    MinHeight="8">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Image x:Name="ImageIconType" Source="{TemplateBinding IconType}" Grid.Column="0" HorizontalAlignment="Left" Margin="5,0" Height="48" Width="48" VerticalAlignment="Center" />
                                        <StackPanel Grid.Column="1" x:Name="ButtonseContent" Orientation="Horizontal" HorizontalAlignment="Right" >
                                        </StackPanel>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:WindowsBoxDatePicker">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:WindowsBoxDatePicker">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowStates">
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootOverlay">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="MessageContent">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="MessageContent">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootOverlay">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="RootOverlay" Background="{TemplateBinding OverlayBrush}" RenderTransformOrigin="0.5,0.5" Opacity="0">
                            <Grid.RenderTransform>
                                <CompositeTransform/>
                            </Grid.RenderTransform>
                            <Grid x:Name="RootMessage" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20" RenderTransformOrigin="0.5,0.5" MaxHeight="{TemplateBinding WindowsMaxHeight}">
                                <Grid.RenderTransform>
                                    <CompositeTransform/>
                                </Grid.RenderTransform>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition />
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border 
                                    Grid.Row="0"
                                    CornerRadius="{TemplateBinding CornerRadiusTop}" 
                                    Background="{TemplateBinding TitleBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessTitle}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}" >
                                    <Grid x:Name="TitleContent">
                                        <TextBlock 
                                            Text="{TemplateBinding Title}" 
                                            Margin="5" 
                                            VerticalAlignment="Center" 
                                            Foreground="{TemplateBinding TitleForeColor}"
                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                            FontSize="{StaticResource PhoneFontSizeMediumLarge}"
                                            HorizontalAlignment="Center" />
                                    </Grid>
                                </Border>
                                <Border 
                                    Grid.Row="1" 
                                    Background="{TemplateBinding MessageBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessMessage}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}">
                                    <Grid x:Name="MessageContent" HorizontalAlignment="Center"  VerticalAlignment="Center" MinHeight="{TemplateBinding WindowsMaxHeight}" MinWidth="{TemplateBinding AllSelectorsWidth}" RenderTransformOrigin="0.5,0.5">
                                        <Grid.RenderTransform>
                                            <CompositeTransform/>
                                        </Grid.RenderTransform>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition x:Name="Col0"/>
                                            <ColumnDefinition x:Name="Col1"/>
                                            <ColumnDefinition x:Name="Col2"/>
                                        </Grid.ColumnDefinitions>
                                        <local:LoopingSelector x:Name="SecondarySelector" Grid.Column="0" Width="140" ItemSize="140,90" ItemMargin="5">
                                            <local:LoopingSelector.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel  HorizontalAlignment="Left" Width="140" VerticalAlignment="Bottom" Margin="3">
                                                        <TextBlock
                                                            Text="{Binding MonthNumber}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="32"
                                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                            Margin="0"/>
                                                        <TextBlock
                                                            Text="{Binding MonthName}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="18"
                                                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                                            Opacity="0.6"
                                                            Margin="0"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </local:LoopingSelector.ItemTemplate>
                                        </local:LoopingSelector>
                                        <local:LoopingSelector x:Name="TertiarySelector" Grid.Column="1" Width="140" ItemSize="140,90" ItemMargin="5">
                                            <local:LoopingSelector.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel  HorizontalAlignment="Left" Width="140" VerticalAlignment="Bottom" Margin="3">
                                                        <TextBlock
                                                            Text="{Binding DayNumber}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="32"
                                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                            Margin="0"/>
                                                        <TextBlock
                                                            Text="{Binding DayName}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="18"
                                                            Visibility="{Binding VisibleDayName}"
                                                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                                            Opacity="0.6"
                                                            Margin="0"/>
                                                        <TextBlock
                                                            Text=" "
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="18"
                                                            Visibility="{Binding VisibleDayName, Converter={StaticResource InverseVisible}}"
                                                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                                            Opacity="0.6"
                                                            Margin="0"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </local:LoopingSelector.ItemTemplate>
                                        </local:LoopingSelector>
                                        <local:LoopingSelector Grid.Column="2" x:Name="PrimarySelector" Width="140" ItemSize="140,90" ItemMargin="5">
                                            <local:LoopingSelector.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel  HorizontalAlignment="Left" Width="140" VerticalAlignment="Bottom" Margin="3">
                                                        <TextBlock
                                                            Foreground="{Binding ForegroundContent}"
                                                            Text="{Binding YearNumber}"
                                                            FontSize="32"
                                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                            Margin="0"/>
                                                        <TextBlock
                                                            Text=" "
                                                            FontSize="18"
                                                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            Margin="0"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </local:LoopingSelector.ItemTemplate>
                                        </local:LoopingSelector>
                                    </Grid>
                                </Border>
                                <Border 
                                    Grid.Row="2" 
                                    CornerRadius="{TemplateBinding CornerRadiusBottom}" 
                                    Background="{TemplateBinding MessageBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessButtons}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}" 
                                    HorizontalAlignment="Stretch" 
                                    MinHeight="8">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Image x:Name="ImageIconType" Source="{TemplateBinding IconType}" Grid.Column="0" HorizontalAlignment="Left" Margin="5,0" Height="48" Width="48" VerticalAlignment="Center" />
                                        <StackPanel Grid.Column="1" x:Name="ButtonseContent" Orientation="Horizontal" HorizontalAlignment="Right" >
                                        </StackPanel>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:WindowsBoxTimePicker">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:WindowsBoxTimePicker">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowStates">
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootOverlay">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="MessageContent">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="MessageContent">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootOverlay">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootMessage">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.35" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="RootOverlay" Background="{TemplateBinding OverlayBrush}" RenderTransformOrigin="0.5,0.5" Opacity="0">
                            <Grid.RenderTransform>
                                <CompositeTransform/>
                            </Grid.RenderTransform>
                            <Grid x:Name="RootMessage" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20" RenderTransformOrigin="0.5,0.5" MaxHeight="{TemplateBinding WindowsMaxHeight}" >
                                <Grid.RenderTransform>
                                    <CompositeTransform/>
                                </Grid.RenderTransform>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition />
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border 
                                    Grid.Row="0"
                                    CornerRadius="{TemplateBinding CornerRadiusTop}" 
                                    Background="{TemplateBinding TitleBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessTitle}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}" >
                                    <Grid x:Name="TitleContent">
                                        <TextBlock 
                                            Text="{TemplateBinding Title}" 
                                            Margin="5" 
                                            VerticalAlignment="Center" 
                                            Foreground="{TemplateBinding TitleForeColor}"
                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                            FontSize="{StaticResource PhoneFontSizeMediumLarge}"
                                            HorizontalAlignment="Center" />
                                    </Grid>
                                </Border>
                                <Border 
                                    Grid.Row="1" 
                                    Background="{TemplateBinding MessageBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessMessage}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}">
                                    <Grid x:Name="MessageContent" HorizontalAlignment="Center"  VerticalAlignment="Center" MinHeight="{TemplateBinding WindowsMaxHeight}" MinWidth="{TemplateBinding AllSelectorsWidth}" RenderTransformOrigin="0.5,0.5">
                                        <Grid.RenderTransform>
                                            <CompositeTransform/>
                                        </Grid.RenderTransform>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition x:Name="Col0"/>
                                            <ColumnDefinition x:Name="Col1"/>
                                            <ColumnDefinition x:Name="Col2"/>
                                        </Grid.ColumnDefinitions>
                                        <local:LoopingSelector x:Name="PrimarySelector" Grid.Column="0" Width="140" ItemSize="140,90" ItemMargin="5">
                                            <local:LoopingSelector.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3">
                                                        <TextBlock
                                                            Text="{Binding HourNumber}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="32"
                                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                            Margin="0"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </local:LoopingSelector.ItemTemplate>
                                        </local:LoopingSelector>
                                        <local:LoopingSelector x:Name="SecondarySelector" Grid.Column="1" Width="140" ItemSize="140,90" ItemMargin="5">
                                            <local:LoopingSelector.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3">
                                                        <TextBlock
                                                            Text="{Binding MinuteNumber}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="32"
                                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                            VerticalAlignment="Center"
                                                            Margin="0"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </local:LoopingSelector.ItemTemplate>
                                        </local:LoopingSelector>
                                        <local:LoopingSelector Grid.Column="2" x:Name="TertiarySelector" Width="140" ItemSize="140,90" ItemMargin="5">
                                            <local:LoopingSelector.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3">
                                                        <TextBlock
                                                            Text="{Binding AmPmString}"
                                                            Foreground="{Binding ForegroundContent}"
                                                            FontSize="32"
                                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                            Margin="0"/>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </local:LoopingSelector.ItemTemplate>
                                        </local:LoopingSelector>
                                    </Grid>
                                </Border>
                                <Border 
                                    Grid.Row="2" 
                                    CornerRadius="{TemplateBinding CornerRadiusBottom}" 
                                    Background="{TemplateBinding MessageBackColor}" 
                                    BorderThickness="{TemplateBinding ThicknessButtons}" 
                                    BorderBrush="{TemplateBinding MessageBorderBrush}" 
                                    HorizontalAlignment="Stretch" 
                                    MinHeight="8">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Image x:Name="ImageIconType" Source="{TemplateBinding IconType}" Grid.Column="0" HorizontalAlignment="Left" Margin="5,0" Height="48" Width="48" VerticalAlignment="Center" />
                                        <StackPanel Grid.Column="1" x:Name="ButtonseContent" Orientation="Horizontal" HorizontalAlignment="Right" >
                                        </StackPanel>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ListPickerPageControl">
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
        <Setter Property="PickerPageUri" Value="/DevPhone.Controls.Toolkit;component/PickerPageControl/ListPickerPage.xaml"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ListPickerPageControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ViewStates">
                                <VisualState x:Name="Enabled" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border>
                            <StackPanel>
                                <ContentControl
                                    x:Name="Header"
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                    FontSize="{StaticResource PhoneFontSizeNormal}"
                                    Foreground="{StaticResource PhoneForegroundBrush}"
                                    HorizontalAlignment="Left"
                                    IsTabStop="False"
                                    Grid.ColumnSpan="2"
                                    Margin="0,0,0,5"
                                    Opacity="{TemplateBinding Opacity}"
                                    VerticalAlignment="Bottom"/>
                                <Border BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}">
                                    <Grid Margin="0" x:Name="AreaHeader" Background="{TemplateBinding Background}">
                                        <ContentControl
                                        x:Name="SeletedContent"
                                        HorizontalAlignment="Stretch"
                                        HorizontalContentAlignment="Left"
                                        Margin="12"
                                        MinHeight="32"    
                                        Foreground="{TemplateBinding Foreground}"
                                        Opacity="{TemplateBinding Opacity}"
                                        VerticalAlignment="Stretch"
                                        VerticalContentAlignment="Center"/>
                                    </Grid>
                                </Border>
                                <Border Opacity="0" Height="0" Width="0">
                                    <ItemsPresenter />
                                </Border>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:CheckPickerPageControl">
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
        <Setter Property="PickerPageUri" Value="/DevPhone.Controls.Toolkit;component/PickerPageControl/CheckPickerPage.xaml"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CheckPickerPageControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ViewStates">
                                <VisualState x:Name="Enabled" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border>
                            <StackPanel>
                                <ContentControl
                                    x:Name="Header"
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                    FontSize="{StaticResource PhoneFontSizeNormal}"
                                    Foreground="{StaticResource PhoneForegroundBrush}"
                                    HorizontalAlignment="Left"
                                    IsTabStop="False"
                                    Grid.ColumnSpan="2"
                                    Margin="0,0,0,5"
                                    Opacity="{TemplateBinding Opacity}"
                                    VerticalAlignment="Bottom"/>
                                <Border BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}">
                                    <Grid Margin="0" x:Name="AreaHeader" Background="{TemplateBinding Background}">
                                        <ContentControl
                                        x:Name="SeletedContent"
                                        HorizontalAlignment="Stretch"
                                        HorizontalContentAlignment="Left"
                                        Margin="12"
                                        MinHeight="32"    
                                        Foreground="{TemplateBinding Foreground}"
                                        Opacity="{TemplateBinding Opacity}"
                                        VerticalAlignment="Stretch"
                                        VerticalContentAlignment="Center"/>
                                    </Grid>
                                </Border>
                                <Border Opacity="0" Height="0" Width="0">
                                    <ItemsPresenter />
                                </Border>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ListPickerItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ListPickerItem">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetName="ContentContainer"
                                            Storyboard.TargetProperty="Foreground"
                                            Duration="0">
                                            <DiscreteObjectKeyFrame
                                                Value="{StaticResource PhoneAccentBrush}"
                                                KeyTime="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <StackPanel HorizontalAlignment="Stretch" Background="#01FFFFFF">
                            <ContentControl
                            x:Name="ContentContainer"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Foreground="{TemplateBinding Foreground}"
                            Margin="0,12"
                            VerticalContentAlignment="Stretch"
                            HorizontalAlignment="Stretch"
                            HorizontalContentAlignment="Stretch"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:LoopingSelector">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Background="Transparent">
                        <Canvas x:Name="ItemsPanel">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <TranslateTransform x:Name="CenteringTransform"/>
                                    <TranslateTransform x:Name="PanningTransform"/>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                        </Canvas>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:LoopingSelectorItem">
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Padding" Value="6"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border x:Name="root" Opacity="0" CacheMode="BitmapCache" Background="Transparent" Padding="{TemplateBinding Padding}">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">

                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.2"/>
                                </VisualStateGroup.Transitions>

                                <VisualState x:Name="Normal"/>

                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="background" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To=".6" Duration="0"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="background" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                    </Storyboard>
                                </VisualState>

                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border.RenderTransform>
                            <TranslateTransform x:Name="Transform"/>
                        </Border.RenderTransform>

                        <Grid>
                            <Rectangle x:Name="background" Margin="2" Opacity="0" Fill="{StaticResource PhoneInactiveBrush}" CacheMode="BitmapCache"/>

                            <Border BorderThickness="2" BorderBrush="{StaticResource PhoneInactiveBrush}">
                                <ContentControl>
                                    <ContentPresenter x:Name="contentPresenter" CacheMode="BitmapCache"/>
                                </ContentControl>
                            </Border>
                        </Grid>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ButtonDatePickerBox" TargetType="Button">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
        <Setter Property="Padding" Value="10,3,10,5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0">
                            <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Stretch"  Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:DatePickerBox">
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="ValueStringFormat" Value="{}{0:d}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DatePickerBox">
                    <StackPanel>
                        <ContentControl
                            x:Name="Header"
                            Content="{TemplateBinding Header}"
                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            HorizontalAlignment="Left"
                            IsTabStop="False"
                            Grid.ColumnSpan="2"
                            Margin="0,0,0,5"
                            Opacity="{TemplateBinding Opacity}"
                            VerticalAlignment="Bottom"/>
                        <Button
                            x:Name="DateTimeButton"
                            Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            FontFamily="{TemplateBinding FontFamily}"
                            Foreground="{TemplateBinding Foreground}"
                            FontSize="{TemplateBinding FontSize}"
                            Style="{StaticResource ButtonDatePickerBox}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Height="58">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding ValueString}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <Image Grid.Column="1" x:Name="IconImage" VerticalAlignment="Center" HorizontalAlignment="Right" Width="48" Height="48" Visibility="Collapsed" Margin="10,0,0,0"/>
                                </Grid>
                            </Button.Content>
                        </Button>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TimePickerBox">
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="ValueStringFormat" Value="{}{0:d}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TimePickerBox">
                    <StackPanel>
                        <ContentControl
                            x:Name="Header"
                            Content="{TemplateBinding Header}"
                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            HorizontalAlignment="Left"
                            IsTabStop="False"
                            Grid.ColumnSpan="2"
                            Margin="0,0,0,5"
                            Opacity="{TemplateBinding Opacity}"
                            VerticalAlignment="Bottom"/>
                        <Button
                            x:Name="DateTimeButton"
                            Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            FontFamily="{TemplateBinding FontFamily}"
                            Foreground="{TemplateBinding Foreground}"
                            FontSize="{TemplateBinding FontSize}"
                            Style="{StaticResource ButtonDatePickerBox}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Height="58">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="{TemplateBinding ValueString}" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                    <Image Grid.Column="1" x:Name="IconImage" VerticalAlignment="Center" HorizontalAlignment="Right" Width="48" Height="48" Visibility="Collapsed" Margin="10,0,0,0"/>
                                </Grid>
                            </Button.Content>
                        </Button>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
